package application.handlers;

import application.RequestHandler;
import application.UserLoggedManager;
import contracts.requests.GetOnlineUserCountRequest;
import contracts.responses.OnlineUserCountResponse;
import io.netty.channel.Channel;

/**
 * 在线人数处理器
 *
 * @author wyl
 */
public class OnlineUserCountHandler extends RequestHandler<GetOnlineUserCountRequest, OnlineUserCountResponse> {
    @Override
    public OnlineUserCountResponse handle(GetOnlineUserCountRequest getOnlineUserCountRequest, Channel requestChannel) {
        return new OnlineUserCountResponse(UserLoggedManager.getUserCount());
    }
}
